package org.leetcode.easy.leetcode344;

import java.util.Arrays;

public class Solution
{
    public void reverseString(char[] s) {

        if (s.length==0 || s.length==1)
        {
            return;
        }

        int left = 0;
        int right = s.length-1;
        char temp = '0';
        while (right>left)
        {
            temp=s[right];
            s[right]=s[left];
            s[left]=temp;

            left++;
            right--;
        }
    }

    public static void main(String[] args) {
        Solution solution = new Solution();

        char []s={'h','e','l','l','o'};
        solution.reverseString(s);

        System.out.println(s);
    }
}
